import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
// import legacy from '@vitejs/plugin-legacy'; ie11 开启此配置

// https://vitejs.dev/config/
export default defineConfig({
  server: {
    proxy: {
      '/trainsys__web': {
        target: 'http://172.16.240.140:50100',
        changeOrigin: true,
      },
    },
    cors: true,
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: '@import "./src/styles/global.scss";',
      },
    },
  },
  plugins: [
    react(),
    // legacy({ targets: ['ie >= 11'] }),
  ],
});
